package org.example.ims.DTO;


import lombok.Data;
import org.example.ims.Entity.User.CustomUser;

import java.util.List;

@Data
public class UserBackDTO {
    private String username;
    private String authorities;

    public UserBackDTO(CustomUser customUser) {

        this.username = customUser.getUsername();
        List<String> roles = customUser.getRoles();
        String rolesString = String.join(", ", roles);
        this.authorities = "Roles:["+ rolesString+"]";
    }
}
